package com.sav.common.forms;

import com.sav.common.catalog.Product;


public class ProductForm {
	
	private String name;
	private String Description;
	private String cost;
	private String weight;
	private String quantity;
	private String idCategory;
	private String idProduct;
	
	
	public void fromProduct(Product p) {
		setName(p.getName());
		setDescription(p.getDescription());
		setCost("" + p.getCost());
		setWeight("" +p.getWeight());
		setQuantity("" +p.getQuantity());
		setIdCategory("" + p.getIdCategory());
		setIdProduct("" + p.getIdProduct());
	}
	
	
	public Product toProduct() {
		return new Product(
				Integer.valueOf(getIdProduct()),
				Integer.valueOf(getIdCategory()),
				getName(),
				getDescription(),
				Integer.valueOf(getCost()),
				Float.valueOf(getWeight()),
				Integer.valueOf(getQuantity()));
	}
	
	public String getName() {
		return name;
	}
	
	public void setName(String name) {
		this.name = name;
	}
	
	public String getDescription() {
		return Description;
	}
	
	public void setDescription(String description) {
		Description = description;
	}
	
	public String getCost() {
		return cost;
	}
	
	public void setCost(String cost) {
		this.cost = cost;
	}
	
	public String getWeight() {
		return weight;
	}
	public void setWeight(String weight) {
		this.weight = weight;
	}
	public String getQuantity() {
		return quantity;
	}
	
	public void setQuantity(String quantity) {
		this.quantity = quantity;
	}
	public String getIdCategory() {
		return idCategory;
	}
	
	public void setIdCategory(String idCategory) {
		this.idCategory = idCategory;
	}
	
	public String getIdProduct() {
		return idProduct;
	}

	public void setIdProduct(String idProduct) {
		this.idProduct = idProduct;
	}
}
